package com;

import java.util.ArrayList;

public class Graphe {

	ArrayList<Node> nodes = new ArrayList<Node>();
	
	public Graphe(){
	}
	
	public void add(Node node){
		nodes.add(node);
	}
	
	public ArrayList<Node> getNoeuds(){
		return nodes;
	}
	
	public Node getNoeud(Modele modele){
		for(Node n : nodes){
			if(n.getModele().equals(modele)){
				return n;
			}
		}
		return null; //non trouvé
	}
	
	public String toString(){
		StringBuffer sb = new StringBuffer();
		//System.out.println(nodes.size() + " noeuds");
		for(Node n : nodes){
			sb.append(n.toString());
		}
		return sb.toString();
	}
	
}
